[#if isRoot]
[{
"text": "<a href='list.do' ><@s.m "global.root"/></a>",
"classes": "folder"
<#if list?size gt 0>,
    "expanded": true,
    "children": [
    [#list list as channel]
    {
    "id": "${channel.id}",
    "text": "<a href='<#if channel.child?size gt 0>list.do?root=${channel.id}<#else>edit.do?id=${channel.id}</#if>'
                >${channel.name}[<span style='color:red'>${channel.type.name}</span>]</a>",
    "classes": "
    <#if channel.child?size gt 0>folder
        <#else>file
    </#if>
    ",
    "hasChildren":
    <#if channel.child?size gt 0>true
        <#else>false
    </#if>
    }
    <#if channel_has_next>,</#if>
    [/#list]
    ]
</#if>
}]
[#else]
[
[#list list as channel]
{
"id": "${channel.id}",
"text": "<a href='<#if channel.child?size gt 0>list.do?root=${channel.id}<#else>edit.do?id=${channel.id}</#if>'
            >${channel.name}[<span style='color:red'>${channel.type.name}</span>]</a>",
"classes": "
<#if channel.child?size gt 0>folder
    <#else>file
</#if>",
"hasChildren":
<#if channel.child?size gt 0>true
    <#else>false
</#if>
}
<#if channel_has_next>,</#if>
[/#list]
]
[/#if]
